Practical Deep Learning for Cloud, Mobile, and Edge by Anirudh Koul

Practical Deep Learning for Cloud, Mobile, and Edge by Anirudh Koul

Author:Anirudh Koul
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2019-10-20T16:00:00+00:00


<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js" type="text/javascript"></script>

Note that we no longer need to import anything related to TensorFlow.js, because it already comes included with ml5.js. We create a simple example where we use the same MobileNet scenario as earlier:

// Initialize the image classifier method with MobileNet const classifier = ml5.imageClassifier('MobileNet', modelLoaded); // Make a prediction with the selected image classifier.predict(document.getElementById('image'), function(err, results) { console.log(results); });

Done! In effectively three lines, a pretrained model is running in our browser. Now, let’s open the browser’s console to inspect the output presented in Figure 10-10.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.